import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import Manager from '@/views/Manager.vue'
import Front from '@/views/Front.vue'



const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/front',
      name: 'Front',
      component: Front,
      redirect: '/newHomePage',
      children: [
        // 新首页
        { path: '/newHomePage', name: 'newHomePage', meta: { name: '新前端首页' }, component: () => import('@/views/front/newHomePage.vue') },

        // 旧首页
        { path: '/adminHomePage', name: 'adminHomePage', meta: { name: '管理员系统首页' }, component: () => import('@/views/front/AdminHomePage.vue') },
        { path: '/principalHomePage', name: 'principalHomePage', meta: { name: '校长系统首页' }, component: () => import('@/views/front/PrincipalHomePage.vue') },
        { path: '/teacherHomePage', name: 'teacherHomePage', meta: { name: '个训师系统首页' }, component: () => import('@/views/front/TeacherHomePage.vue') },
        { path: '/parentHomePage', name: 'parentHomePage', meta: { name: '家长系统首页' }, component: () => import('@/views/front/ParentHomePage.vue') },
        { path: '/assessmentTools', name: 'assessmentTools', meta: { name: '测评工具' }, component: () => import('@/views/front/AssessmentTools.vue')},
        // 测试功能下界面
        { path: '/diagnosticTool', name: 'diagnosticTool', meta: { name: '诊断工具界面' }, component: () => import('@/views/assessmentTool/DiagnosticTool.vue') },
        { path: '/skillTool', name: 'skillTool', meta: { name: '技能评估工具界面' }, component: () => import('@/views/assessmentTool/SkillTool.vue') },
        { path: '/languageSpeech', name: 'languageSpeech', meta: { name: '言语语言界面' }, component: () => import('@/views/assessmentTool/LanguageSpeech.vue') },
        { path: '/ganTong', name: 'ganTong', meta: { name: '感统' }, component: () => import('@/views/assessmentTool/GanTong.vue') },
        { path: '/motion', name: 'motion', meta: { name: '运动' }, component: () => import('@/views/assessmentTool/MotionTool.vue') },
        // 学员，员工管理
        { path: '/staffMgmt1', name: 'staffMgmt', meta: { name: '员工，学员管理' }, component: () => import('@/views/staffMgmt/StaffMgmt.vue') },

        // 康复训练： 布置作业 点评作业
        { path: '/rehabilitationTraining', name: 'rehabilitationTraining', meta: { name: '布置作业老师' }, component: () => import('@/views/rehabilitationTraining/RehabilitationTraining.vue') },
        // 康复训练： 布置作业 创建作业
        { path: '/assignHomework', name: 'assignHomework', meta: { name: '布置作业老师' }, component: () => import('@/views/assignHomework/AssignHomework.vue') },
        // 康复训练：  点评作业老师界面
        { path: '/commentHomework', name: 'commentHomework', meta: { name: '点评作业' }, component: () => import('@/views/commentHomework/CommentHomework.vue') },
        // 康复训练：  点评作业管理员 校长界面
        { path: '/aCommentWork', name: 'aCommentWork', meta: { name: '点评作业' }, component: () => import('@/views/commentHomework/ACommentWork.vue') },
         //         布置作业校长界面
        { path: '/principalRehabilitationTraining', name: 'principalRehabilitationTraining', meta: { name: '康复训练校长界面' }, component: () => import('@/views/rehabilitationtraining/PrincipalRehabilitationTraining.vue') },
        //          布置作业老师界面
        { path: '/tAssignHomework', name: 'tAssignHomework', meta: { name: '布置作业老师界面' }, component: () => import('@/views/assignHomework/TAssignHomework.vue') },
        //   布置作业  ： 创建作业
        { path: '/tEstablishHomework', name: 'tEstablishHomework', meta: { name: '创建作业老师界面' }, component: () => import('@/views/assignHomework/TestablishHomework.vue') },
        //  创建作业 ： 创建作业界面
        { path: '/createHomeWork', name: 'createHomeWork', meta: { name: '创建作业界面' }, component: () => import('@/views/assignHomework/CreateHomeWork.vue') },

        { path: '/tRehabilitationtraining', name: 'tRehabilitationTraining', meta: { name: '康复训练老师界面' }, component: () => import('@/views/rehabilitationtraining/TRehabilitationTraining.vue') },
        { path: '/parentRehabilitationTraining', name: 'parentRehabilitationTraining', meta: { name: '康复训练家长端界面' }, component: () => import('@/views/rehabilitationtraining/ParentRehabilitationTraining.vue') },
        // 测评记录
        { path: '/evaluationRecord', name: 'evaluationRecord', meta: { name: '测评记录界面' }, component: () => import('@/views/evaluationRecord/EvaluationRecord.vue') },
        // 设置界面
        { path: '/setUpHome', name: 'setUpHome', meta: { name: '设置更新界面' }, component: () => import('@/views/setUp/UpdateSetting.vue') },
        { path: '/systemSetting', name: 'systemSetting', meta: { name: '系统设置界面' }, component: () => import('@/views/setUp/SystemSetting.vue') },
        // Training records训练记录
        { path: '/trainingRecords', name: 'trainingRecords', meta: { name: '训练记录' }, component: () => import('@/views/trainingRecords/TrainingRecords.vue') },

        { path: '/frontHome', name: 'frontHome', meta: { name: '系统首页' }, component: () => import('@/views/front/FrontHome.vue') },
        { path: '/taskCenter', name: 'taskCenter', meta: { name: '任务老师' }, component: () => import('@/views/front/TaskCenter.vue') },
        { path: '/assignTask', name: 'assignTask', meta: { name: '布置任务' }, component: () => import('@/views/front/AssignTask.vue') },
        { path: '/assignTask', name: 'assignTask', meta: { name: '布置任务' }, component: () => import('@/views/front/AssignTask.vue') },
        //{ path: '/staffMgmt', name: 'staffMgmt', meta: { name: '员工管理' }, component: () => import('@/views/front/StaffMgmt.vue') },
      ]

    },
    // 测评报告结果界面
    {
      path: '/reportingResults',
      name: 'reportingResults',
      component: () => import('@/views/evaluationRecord/ReportingResults.vue')
    },

    // 资源库界面
    {
      path: '/resourceLibrary',
      name: 'resourceLibrary',
      component: () => import('@/views/resourceLibrary/ResourceLibrary.vue')
    },
    //  积分兑换界面
    {
      path: '/pointsRedemption',
      name: 'pointsRedemption',
      component: () => import('@/views/pointsRedemption/PointsRedemption.vue')
    },
    // 基础练习
    {
      path: '/basicsPractice',
      name: 'basicsPractice',
      component: () => import('@/views/basicsPractice/BasicsPractice.vue')
    },
    {
      path: '/',
      name: 'Manager',
      component: Manager,
      redirect: '/login',
      children: [
        // { path: '/adminPerson', name: 'AdminPerson', component: AdminPerson },
        { path: '/home', name: 'Home', meta: { name: '系统首页' }, component: () => import('@/views/manager/Home.vue') },
        { path: '/registrationMgmt', name: 'registrationMgmt', meta: { name: '登记管理' }, component: () => import('@/views/manager/RegistrationMgmt.vue') },
        { path: '/jobMgmt', name: 'jobMgmt', meta: { name: '评估管理' }, component: () => import('@/views/manager/JobMgmt.vue') },
        { path: '/studentMgmt', name: 'studentMgmt', meta: { name: '学员管理' }, component: () => import('@/views/manager/StudentMgmt.vue') },
        { path: '/archivesMgmt', name: 'archivesMgmt', meta: { name: '档案管理' }, component: () => import('@/views/manager/ArchivesMgmt.vue') },
        { path: '/experienceRole', name: 'experienceRole', meta: { name: '体验角色' }, component: () => import('@/views/manager/ExperienceRole.vue') },
        { path: '/setUpView', name: 'setUpView', meta: { name: '设置' }, component: () => import('@/views/manager/SetUpView.vue') },
        { path: '/teachMonitor', name: 'teachMonitor', meta: { name: '教学监控' }, component: () => import('@/views/manager/TeachMonitor.vue') },
        { path: '/textBook', name: 'textBook', meta: { name: '教材' }, component: () => import('@/views/manager/TextBook.vue') },
        { path: '/workPlan', name: 'workPlan', meta: { name: '工作计划' }, component: () => import('@/views/manager/WorkPlan.vue') },
        { path: '/acquisitionView', name: 'acquisitionView', meta: { name: '引流获客' }, component: () => import('@/views/manager/AcquisitionView.vue') },

      ]
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue')
    },
    {
      path: '/module',
      name: 'Module',
      component: () => import('../views/front/ModuleView.vue')
    },
    {
      path: '/login',
      name: 'Login',
      component: () => import('../views/LoginView.vue')
    },
    { path: '/:pathMatch(.*)', name: 'NotFound', meta: { name: '无法访问' }, component: () => import('../views/404.vue') }
  ]
})

export default router
